package com.member.common.enums;

import lombok.Getter;

import java.util.Objects;

/**
 * @author wangxin
 */
@Getter
public enum IndexTypeEnum {
    /**
     * 首页资讯模块
     */
    INDEX_NEWS(1, "首页资讯模块"),

    /**
     * 金刚区
     */
    JINGGANG( 0, "金刚区"),

    /**
     * 广告位
     */
    ADVERTISEMENT( 2, "广告位"),
    ;

    private final Integer key;
    private final String desc;

    IndexTypeEnum(Integer key, String desc) {
        this.key = key;
        this.desc = desc;
    }

    public static IndexTypeEnum getByKey(Integer key){
        for (IndexTypeEnum item : IndexTypeEnum.values()){
            if(Objects.equals(item.getKey(), key)){
                return item;
            }
        }
        return null;
    }

}
